<!--  -->
<template>
  <div class="box3">孙组件2{{ userInfo.name }}</div>
</template>

<script lang='ts' setup>
import { reactive,toRefs,ref,inject} from 'vue'
const userInfo:any= inject("userInfo"); 

</script>
<style scoped>
.box3{
    width: 100%;
    height: 100px;
    background: blue;
}
</style>